﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace Project
{
    public class PhoneValidationRule : ValidationRule
    {
        public override ValidationResult Validate(object value, CultureInfo cultureInfo)
        {
            if (string.IsNullOrEmpty((string)value))
                return new ValidationResult(true, null);
            else
            {
                if(((string)value).Length<7)
                return new ValidationResult(false, "El numero de telefono no puede ser de longitud menor a 7 digitos");
            }
            return new ValidationResult(true, null);
        }
    }
}
